class CreateChangeOrders < ActiveRecord::Migration
  def self.up
    create_table :change_orders do |t|
      t.integer   :project_id, :null => false
      t.integer   :sub_contractor_id, :null => false
      t.boolean   :is_effective, :default => false
      t.datetime  :effective_at
      t.string    :summary, :null => false
      t.text      :description, :null => false
      t.string    :recommended_by
      t.datetime  :recommended_at
      t.string    :accepted_by
      t.datetime  :accepted_at
      t.timestamps
    end
    
    add_index :change_orders, :project_id
  end

  def self.down
    drop_table :change_orders
  end
end
